1 using UnityEngine;
2
3 namespace
ProceduralToolkit.Examples.Primitives
4 {
5     
[RequireComponent(typeof(MeshRenderer), typeof(MeshFilter))]
6     
public class Cylinder : MonoBehaviour
7     {
8         
public float radius = 1f;
9         
public int segments = 16;
10         
public float height = 2f;
11
12         
private void Start()
13         {
14             GetComponent<MeshFilter>().mesh = MeshE.Cylinder(radius, segments, height);
15         }
16     }
17 }


Gõ tìm kiếm nhanh...